package Person.ith_25;

public class JumppingDemo {
    public static void main(String[] args) {
        JumppingOperator jo = new JumppingOperator();
Jumpping j = new Cat();
jo.useJumpping(j);
Jumpping j2 = jo.getJumpping();
j2.jump();
    }
}

class Cat implements Jumpping{

    @Override
    public void jump() {
        System.out.println("猫可以跳高了");
    }
}
 class JumppingOperator {
    public void useJumpping(Jumpping j){
        j.jump();
    }
    public Jumpping getJumpping(){
        Jumpping j = new Cat();
        return j;
    }

}
 interface Jumpping {
    void jump();
}
